!> author: 左志华
!> date: 2022/05/12
!>
!> GSL 库的快速傅里叶变换
module gsl_wavelet_m

    use, intrinsic :: iso_c_binding

    interface
        function gsl_wavelet_alloc(t, k) bind(c)
            import
            type(c_ptr), value :: t
            integer(c_size_t), value :: k
            type(c_ptr) :: gsl_wavelet_alloc
        end function gsl_wavelet_alloc
        function gsl_wavelet_name(wavelet) bind(c)
            import
            type(c_ptr), value :: wavelet
            type(c_ptr) :: gsl_wavelet_name
        end function gsl_wavelet_name
        subroutine gsl_wavelet_free(w) bind(c)
            import
            type(c_ptr), value :: w
        end subroutine gsl_wavelet_free
        function gsl_wavelet_workspace_alloc(n) bind(c)
            import
            integer(c_size_t), value :: n
            type(c_ptr) :: gsl_wavelet_workspace_alloc
        end function gsl_wavelet_workspace_alloc
        subroutine gsl_wavelet_workspace_free(w) bind(c)
            import
            type(c_ptr), value :: w
        end subroutine gsl_wavelet_workspace_free
        function gsl_wavelet_transform(w, data, stride, n, dir, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: stride, n
            integer(c_int), value :: dir
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet_transform
        end function gsl_wavelet_transform
        function gsl_wavelet_transform_forward(w, data, stride, n, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: stride, n
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet_transform_forward
        end function gsl_wavelet_transform_forward
        function gsl_wavelet_transform_inverse(w, data, stride, n, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: stride, n
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet_transform_inverse
        end function gsl_wavelet_transform_inverse
        function gsl_wavelet2d_transform(w, data, tda, size1, size2, dir, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: tda, size1, size2
            integer(c_int), value :: dir
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet2d_transform
        end function gsl_wavelet2d_transform
        function gsl_wavelet2d_transform_forward(w, data, tda, size1, size2, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: tda, size1, size2
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet2d_transform_forward
        end function gsl_wavelet2d_transform_forward
        function gsl_wavelet2d_transform_inverse(w, data, tda, size1, size2, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: tda, size1, size2
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet2d_transform_inverse
        end function gsl_wavelet2d_transform_inverse
        function gsl_wavelet2d_transform_matrix(w, m, dir, work) bind(c)
            import :: c_ptr, c_int
            type(c_ptr), value :: w, m, work
            integer(c_int), value :: dir
            integer(c_int) :: gsl_wavelet2d_transform_matrix
        end function gsl_wavelet2d_transform_matrix
        function gsl_wavelet2d_transform_matrix_forward(w, m, work) bind(c)
            import :: c_ptr, c_int
            type(c_ptr), value :: w, m, work
            integer(c_int) :: gsl_wavelet2d_transform_matrix_forward
        end function gsl_wavelet2d_transform_matrix_forward
        function gsl_wavelet2d_transform_matrix_inverse(w, m, work) bind(c)
            import :: c_ptr, c_int
            type(c_ptr), value :: w, m, work
            integer(c_int) :: gsl_wavelet2d_transform_matrix_inverse
        end function gsl_wavelet2d_transform_matrix_inverse
        function gsl_wavelet2d_nstransform(w, data, tda, size1, size2, dir, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: tda, size1, size2
            integer(c_int), value :: dir
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet2d_nstransform
        end function gsl_wavelet2d_nstransform
        function gsl_wavelet2d_nstransform_forward(w, data, tda, size1, size2, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: tda, size1, size2
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet2d_nstransform_forward
        end function gsl_wavelet2d_nstransform_forward
        function gsl_wavelet2d_nstransform_inverse(w, data, tda, size1, size2, work) bind(c)
            import
            type(c_ptr), value :: w
            type(c_ptr), value :: data
            integer(c_size_t), value :: tda, size1, size2
            type(c_ptr), value :: work
            integer(c_int) :: gsl_wavelet2d_nstransform_inverse
        end function gsl_wavelet2d_nstransform_inverse
        function gsl_wavelet2d_nstransform_matrix(w, m, dir, work) bind(c)
            import :: c_ptr, c_int
            type(c_ptr), value :: w, m, work
            integer(c_int), value :: dir
            integer(c_int) :: gsl_wavelet2d_nstransform_matrix
        end function gsl_wavelet2d_nstransform_matrix
        function gsl_wavelet2d_nstransform_matrix_forward(w, m, work) bind(c)
            import :: c_ptr, c_int
            type(c_ptr), value :: w, m, work
            integer(c_int) :: gsl_wavelet2d_nstransform_matrix_forward
        end function gsl_wavelet2d_nstransform_matrix_forward
        function gsl_wavelet2d_nstransform_matrix_inverse(w, m, work) bind(c)
            import :: c_ptr, c_int
            type(c_ptr), value :: w, m, work
            integer(c_int) :: gsl_wavelet2d_nstransform_matrix_inverse
        end function gsl_wavelet2d_nstransform_matrix_inverse
!
        function fgsl_aux_wavelet_alloc(i) bind(c)
            import
            integer(c_int), value :: i
            type(c_ptr) :: fgsl_aux_wavelet_alloc
        end function fgsl_aux_wavelet_alloc
        function gsl_aux_sizeof_wavelet_workspace() bind(c)
            import :: c_size_t
            integer(c_size_t) :: gsl_aux_sizeof_wavelet_workspace
        end function gsl_aux_sizeof_wavelet_workspace
        function gsl_aux_sizeof_wavelet() bind(c)
            import :: c_size_t
            integer(c_size_t) :: gsl_aux_sizeof_wavelet
        end function gsl_aux_sizeof_wavelet
    end interface

end module gsl_wavelet_m
